home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 July / Chip_1998-07_cd.bin / zkuste / mazda / STW311.dxr / Internal_5_UI Pushbutton.ls < prev    next >
Encoding:
Text File  |  1998-05-12  |  1.7 KB  |  54 lines

  1. property UpCM, DownCM, UpNum, DownNum, button_active
  2.  
  3. on mouseDown me
  4.   set the member of sprite the spriteNum of me to member the DownCM of me
  5.   set the button_active of me to 1
  6. end
  7.  
  8. on mouseUp me
  9.   set the member of sprite the spriteNum of me to member the UpCM of me
  10.   set the button_active of me to 0
  11. end
  12.  
  13. on mouseEnter me
  14.   if the button_active of me then
  15.     set the member of sprite the spriteNum of me to member the DownCM of me
  16.   end if
  17. end
  18.  
  19. on mouseLeave me
  20.   if the button_active of me then
  21.     set the member of sprite the spriteNum of me to member the UpCM of me
  22.   end if
  23. end
  24.  
  25. on mouseUpOutSide me
  26.   set the button_active of me to 0
  27. end
  28.  
  29. on beginSprite me
  30.   set the UpCM of me to the member of sprite the spriteNum of me
  31.   set the UpNum of me to the number of member UpCM
  32.   set the DownNum of me to the number of member DownCM
  33.   set the button_active of me to 0
  34. end
  35.  
  36. on endSprite me
  37. end
  38.  
  39. on getPropertyDescriptionList
  40.   if the currentSpriteNum = 0 then
  41.     set memdefault to 0
  42.   else
  43.     set memref to the member of sprite the currentSpriteNum
  44.     set castLibNum to the castLibNum of memref
  45.     set memdefault to member (the memberNum of member memref + 1) of castLib castLibNum
  46.   end if
  47.   set p_list to [#DownCM: [#comment: "Hilite Image:", #format: #graphic, #default: memdefault]]
  48.   return p_list
  49. end
  50.  
  51. on getBehaviorDescription
  52.   return "Makes a sprite work as a pushbutton with automatic highlighting and mouse tracking. The sprite's initial castmember represents the button's normal state." & RETURN & "PARAMETERS:" & RETURN & "ΓÇó Hilite Image - Choose the cast member to display when the button is pressed. The default value is the cast member immedietly following the sprite's current cast member."
  53. end
  54.